/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Negocio;

/**
 *
 * @author sistemas
 */
public class Entero {
    private int  Num;

    public int getNum() {
        return Num;
    }

    public void setNum(int Num) {
        this.Num = Num;
    }
  
    public boolean Par(){
return Num %2==0;
}
public long factorial(){
try{
long ac=1;
for(int i=1;i<=Num;i++){

ac=ac*i;
}
return ac;
}
catch(Exception a ){
return 0;
}
}
public boolean  primo(){

if(Num ==1){
return false;
}
else{
    for(int i=2;i<=Num;i++){
        if((Num%i)==0){
                    if(Num ==i){
                    return true;
                    }
                    else{
                    return  false;
                    }
        }
    }
}
return false;
}
public int Invertir(){
int aux=Num;
int ac=0;
        while(Num>0){
        int residuo=Num%10;
        ac=ac*10+residuo;
        Num=Num/10;
        }
Num=aux;
return ac;
}
public boolean capicua(){

return Num==this.Invertir();
}

public int EliminarDigitoPrimo(){

int aux=Num;
int ac=0;
        while(Num>0){
        int residuo=Num%10;
        Entero obj2=new Entero();
        obj2.setNum(residuo);
        if(obj2.primo()){
        ac=ac*10+residuo;
        }
        Num=Num/10;
        }
Num=aux;
return ac;
}
public long fibonacci(){
    
int num1 =0;
int num2=1;
int temp;
int limite=Num; //escribir nombre de textbox
    //System.out.println(num1);
    //System.out.println(num2);
    while(num2+num1<=limite){
    temp=num1;
    num1=num2;
    num2=temp+num1;
   // System.out.println(num2);
    
    }
        return num2;
}
}
